package com.maomao.permission.controller;

import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import com.maomao.permission.model.UserInfo;

@Controller
public class PageController {

	
	@GetMapping("/welcome")
	public String welcome(Model model){
		UserInfo user= (UserInfo) SecurityUtils.getSubject().getPrincipal();
		model.addAttribute("permissions",user.getPermissions());
		return "index";
	}
	@GetMapping("/403")
	public String error(){
		return "403";
	}
}
